<div class="modal-header">
    <h3 class="modal-title">清理任务日志</h3>
</div>
<div class="modal-body">
    <div style="margin-top: 5px;">
        <table class="table table-hover table-bordered table-striped">
            <thead>
            <tr>
                <td>服务器</td>
                <td>IP</td>
                <td>环境</td>
                <td>磁盘使用率</td>
                <td>归档(天)</td>
                <td>启用</td>
                <td>详情</td>
                <td ng-if="contains(authPoint, '/server/power')">操作</td>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <b style="color: #286090">{{item.serverName}}-{{item.serialNumber}}</b>
                </td>
                <td>
                    </span>{{item.serverDO.insideIp}}</span>
                </td>
                <td>
                    <b style="color: #777" ng-if="item.envType == 0">保留</b>
                    <b style="color: #5bc0de" ng-if="item.envType == 1">dev</b>
                    <b style="color: #449d44" ng-if="item.envType == 2">daily</b>
                    <b style="color: #ec971f" ng-if="item.envType == 3">gray</b>
                    <b style="color: #d9534f" ng-if="item.envType == 4">prod</b>
                    <b style="color: #5e5e5e" ng-if="item.envType == 5">test</b>
                    <b style="color: #286090" ng-if="item.envType == 6">back</b>
                    <b style="color: #ff5f87" ng-if="item.envType == 7">pre</b>
                </td>
                <td>
                    <div class="col-md-3">
                        <span class="label" style="background-color: #777; color: white;">
                            <i class="glyphicon glyphicon-hdd">
                            </i>{{item.diskType}}</span>
                    </div>
                    <div class="col-md-8" style="margin-left:5px; margin-top:1px;">
                        <div class="progress" ng-show="item.freeDiskSpace != -1">
                            <span class="progress-bar" role="progressbar"
                                  uib-popover-html="item.sizeView" popover-trigger="'mouseenter'"
                                  ng-show="item.freeDiskSpace < 15"
                                  aria-valuenow="item.diskRate" aria-valuemin="0"
                                  aria-valuemax="100"
                                  style="min-width: 2em; background-color: #c9302c; width: {{100 - item.freeDiskSpace}}%;">
                                <b>{{100 - item.freeDiskSpace}}%</b>
                            </span>
                            <span class="progress-bar" role="progressbar"
                                  uib-popover-html="item.sizeView" popover-trigger="'mouseenter'"
                                  ng-show="item.freeDiskSpace >= 15"
                                  aria-valuenow="item.diskRate" aria-valuemin="0"
                                  aria-valuemax="100"
                                  style="min-width: 2em; background-color: #20a03f; width: {{100 - item.freeDiskSpace}}%;">
                                <b>{{100 - item.freeDiskSpace}}%</b>
                            </span>
                        </div>
                    </div>
                </td>
                <td>{{item.viewHistory}}</td>
                <td>
                    <b class="fa fa-circle-o"
                       uib-popover-html="'禁用'" popover-trigger="'mouseenter'"
                       style="color: #777" ng-if="item.enabled == 0"></b>
                    <b class="fa fa-circle"
                       uib-popover-html="'启用'" popover-trigger="'mouseenter'"
                       style="color: #449d44" ng-if="item.enabled == 1"></b>
                </td>
                <td>
                     <span class="label" uib-popover-html="item.updateTime"
                           popover-trigger="'mouseenter'"
                           style="background-color: #ff8700; color: white;">采样:{{item.updateTimeView}}</span>
                    <div ng-show="item.enabled">
                        <span class="label" uib-popover-html="item.cleanupTime"
                              ng-show="item.cleanupTime != ''"
                              popover-trigger="'mouseenter'"
                              style="background-color: #ff5f87; color: white;">清理:{{item.cleanupTimeView}}</span>
                    </div>
                </td>
            </tr>
            </tbody>
            <tfoot>
        </table>

        <div style="font-size:0.5em;">&nbsp;</div>
        <div class="panel panel-info">
            <div class="panel-heading">清理日志</div>
            <!--<div ng-if="pageData != null">-->
                <!--&lt;!&ndash;style="margin-left: 20px;&ndash;&gt;-->
                <!--<span class="label label-danger" ng-show="taskVO.ansibleTaskDO.finalized ==false">-->
                                     <!--<i class="fa fa-spin fa-spinner"></i>指令执行中...</span>-->
                <!--<span class="label label-success"-->
                      <!--ng-show="taskVO.ansibleTaskDO.finalized ==true">指令执行完成</span>-->
                <!--<span class="label"-->
                      <!--uib-popover-html="'执行的指令'"-->
                      <!--popover-trigger="'mouseenter'"-->
                      <!--style="background-color: black">{{taskVO.ansibleTaskDO.cmd}}</span>-->
                <!--<span class="label"-->
                      <!--uib-popover-html="'服务器数量'"-->
                      <!--popover-trigger="'mouseenter'"-->
                      <!--style="background-color: #d78700">Total:{{taskVO.ansibleTaskDO.serverCnt}}</span>-->

                <!--<input type="checkbox" ng-model="resultChoose.all" ng-click="chooseAllResult()"><b-->
                    <!--style="color: #00a8f3"> 所有结果</b>-->
                <!--<input type="checkbox" ng-model="resultChoose.success" ng-click="chooseResult(0)"><b-->
                    <!--style="color: #00af00"> SUCCESS</b>-->
                <!--<input type="checkbox" ng-model="resultChoose.failed" ng-click="chooseResult(1)"><b-->
                    <!--style="color: #b92c28"> FAILED</b>-->
            <!--</div>-->

            <div class="form-group">
                <form class="form-inline" role="form" ng-if="pageData != null">
                    <table class="table" style="margin-top: 5px;">
                        <tbody>
                        <tr ng-repeat="taskLog in pageData">
                            <td class="col-md-12">
                                <div class="panel-heading" style="background-color: #8c8c8c">
                                    <span class="label label-success" ng-if="taskLog.success">{{taskLog.result}}</span>
                                    <span class="label label-danger" ng-if="!taskLog.success">{{taskLog.result}}</span>
                                    <span class="label label-info"
                                          ng-show="taskLog.returncode != null">{{taskLog.returncode}}</span>

                                    <span class="label label-info pull-right">{{taskLog.gmtCreate}}</span>

                                    <!--<button ng-click="closeTaskServer(taskLog.serverId)"-->
                                            <!--class="btn btn-xs pull-right"-->
                                            <!--style="margin-left: 20px; background-color: #ff8700; color: white;">-->
                                        <!--<span class="glyphicon glyphicon-remove"></span>关闭-->
                                    <!--</button>-->
                                </div>
                                <div hljs hljs-source="taskLog.msg"></div>
                            </td>
                        </tr>
                        </tbody>
                        <tfoot>
                        <tr>
                            <td colspan="1">
                                <ul style="margin: 0px; float: right;" uib-pagination
                                    total-items="totalItems" ng-model="currentPage"
                                    items-per-page="pageLength" max-size="10"
                                    ng-change="pageChanged()" previous-text="&lsaquo;"
                                    next-text="&rsaquo;"></ul>
                            </td>
                        </tr>
                        </tfoot>
                    </table>

                </form>
            </div>
        </div>
    </div>
    <form class="bs-example form-horizontal">

        <div class="form-group">
            <div style="text-align:center;">
                <button ng-click="doTask()"
                        class="btn btn-xs"
                        style="background-color: #ff8700; color: white;">
                    <span class="glyphicon glyphicon-grain"></span>清理
                </button>

            </div>
        </div>
    </form>
    <div ng-if="alert.type != ''">
        <div uib-alert ng-class="'alert-' + alert.type" close="closeAlert()">{{alert.msg}}</div>
    </div>
</div>